<!DOCTYPE html>
<title>Make sure preferred width calculations stabilize when a child has overflow:auto</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<div style="height: 100%; position: absolute;">
  <div style="display:flex; height: 100%;">
    <div>
      <div style="display: flex; flex-direction: column; height: 100%;">
        <p>test</p>
        <div id="content" style="flex: auto; position: relative; overflow: auto;">
          <p style="position: absolute;">test</p>
        </div>
      </div>
    </div>
  </div>
</div>
<script>
test(function() {
  document.getElementById('content').offsetTop;
}, "Hooray, no infinite loop.");
</script>
